package com.zy.pro.system;

import javax.servlet.http.HttpServletRequest;

/**
 * 
 * @author gaoyufeng
 *
 */
public class SystemCnt {
	//运维人员区域ID
	public static final Integer EMPLOYEE_SERVER_YES_REGIONID = -1;//运维人员区域ID
	
	//员工状态
	public static final Integer EMPLOYEE_FLAG_YES = 1;//删除
	public static final Integer EMPLOYEE_FLAG_NO = 2;//未删除
	//是否为超级管理员
	public static final Integer EMPLOYEE_SUPERADMIN_YES = 1;//是
	public static final Integer EMPLOYEE_SUPERADMIN_NO = 2;//否
	//是否为运维人员
	public static final Integer EMPLOYEE_SERVER_YES = 1; //是
	public static final Integer EMPLOYEE_SERVER_NO = 2; //否
	//角色管理类型
	public static final Integer ROLE_REL_MENU=0;
	public static final Integer ROLE_REL_RESOURCE=1;
	

	//角色类型（）
	public static final Integer ROLE_STATUS_1 = 1;	//小区管理员
	public static final Integer ROLE_STATUS_2 = 2;  //小区管家
	
	public static final String EMPLOYEE_PASSWORD = "123456";
	
	public static String getIpAddr(HttpServletRequest request) {
		String ip = request.getHeader("x-forwarded-for");
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
			ip = request.getHeader("Proxy-Client-IP");
		}
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
			ip = request.getHeader("WL-Proxy-Client-IP");
		}
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
			ip = request.getRemoteAddr();
		}
		return ip;
	}
}
